home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / progut~1 / gperf.zoo / src / trace.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-25  |  309 b   |  19 lines

  1. #pragma once
  2.  
  3. #ifdef TRACE
  4. #define T(X) X
  5. #else
  6. #define T(X)
  7. #endif
  8.  
  9. class Trace
  10. {
  11. private:
  12.   static int nesting;
  13.   char *name;
  14. public:
  15.   Trace (char *n) { fprintf (stderr, "%*scalling %s\n", 3 * nesting++, "", name = n); }
  16.  ~Trace (void) { fprintf (stderr, "%*sleaving %s\n", 3 * --nesting, "", name); }
  17. };
  18.  
  19.